<?php
	####################################################
	# library import and object instance.              #
	####################################################
	# 커먼 인클루드
	include_once( '../common.php' );

	####################################################
	# request data($_POST AND $_GET FROM $_REQUEST)    #
	####################################################
	# REQUEST(get and post variables)
	//*/
	$req = $_REQUEST;
	//$req = Request::clean_request($_REQUEST, 1);
	//Nlog::puts($req);
	//*/

	# GET(url variables)
	//*/
	//*/

	# POST(form variables)
	///*/
	$pmode = Request::clean_individual($_POST['mode']);
	$preturl = Request::clean_individual($_POST['returl']);
	//Nlog::puts('pmode',$pmode);
	//Nlog::puts('preturl',$preturl);
	//*/

	# Validation(special case validate)
	/*/
	Validation::check_is_emptys($pmode);
	Validation::check_is_emptys($preturl);
	//*/
	####################################################
	# implementation                                   #
	####################################################
	$sec->individual_access();
	$sec->run_cookie_check();

	switch($pmode) {
		case "modify":
			$pmap = Request::dic($_POST['map'], 'uid');
			$cnt = $epnt->modify_entry_points($pmap);
			//Nlog::puts($pmap);
		break;
		case "create":
			$pmap = Request::clean_request($_POST['map']);
			$cnt = $epnt->create_entry_points($pmap);
			//Nlog::puts($pmap);
		break;
		default : break;
	} //endswitch


?>
<?php
	# HTML START
	echo $html->custom_header(TITLE);
	echo $tplt->page_construct_javascript();
	echo $html->custom_js("{$JS}common.js");
	echo $html->custom_css("{$CSS}common.css");
	echo $html->custom_body();
?>
	<?php $tplt->app_head($NAVI)?>
	<?php $tplt->tiles_admin_sidebar($NAVI)?>
	<?php $tplt->tiles_admin_contents($pkname, $pname, $pdesc)?>

	<div class="msgbox">
		<p>
			<?php switch($pmode): case NULL : Mover::error(); break; ?>
				<?php case "modify" : ?>
					<strong>엔트리포인트 수정</strong><br />
					<?=$cnt?>개의 엔트리포인트가 수정 되었습니다.
				<?php break; ?>
				<?php case "create" : ?>
					<strong>엔트리포인트 생성</strong><br />
					<?=$cnt?>개의 엔트리포인트가 생성 되었습니다. 로직을 구현 하시기 바랍니다.
				<?php break; ?>
				<?php default : break; ?>
			<?php endswitch; ?>
		</p>
	</div>
	<span class="cbtn_s mart5" onclick="Mover.href('<?=$preturl?>');">확인</span>


<?php
	# HTML END
	echo $tplt->tiles_admin_footer();
	echo $tplt->page_destruct_javascript();
	include_once( '../endproc.php' );
	echo $html->html_footer();
?>